package com.xing.sbmongodb.domian;


import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
//保存到叫user的集合中去
@Document(collation = "user")
public class User {

    //属性映射到mongoDB的集合中的字段上
    @Id
    private String id;
    @Field("name")
    private String name;
    @Field("password")
    private String password;
    @Field("address")
    private String address;
    @Field("create_time")
    private Date createTime;
    @Field("last_update_time")
    private Date lastUpdateTime;

}
